package com.zqxq.lottery.controller.jczq;

import com.baomidou.mybatisplus.plugins.Page;
import com.zqxq.common.constant.Result;
import com.zqxq.common.enums.CodeEnum;
import com.zqxq.lottery.service.jczq.IJczqMatchResultService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@Slf4j
public class JczqMatchResultController extends JczqBaseController {

    @Autowired
    private IJczqMatchResultService jczqMatchResultService;

    @PostMapping("/match/result/list")
    public Result matchResultList(@RequestBody Map<String,Object> paramMap){
        Result rs = new Result();
        try{
            Page page = jczqMatchResultService.matchResultList(paramMap);
            rs.setData(page);
        }catch(Exception e){
            rs.setCode(CodeEnum.FAIL.getCode());
            rs.setMsg(CodeEnum.FAIL.getMsg());
            log.error("Query matchResultList Error:",e);
        }
        return rs;
    }
}
